home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / OPTANS10.ARJ / AUSER.H next >
C/C++ Source or Header  |  1992-06-09  |  2KB  |  65 lines

  1. /******************************************************************************
  2.                                                              OptANSI Library
  3.                                                  Copyright 1992 Michael Dannov
  4. This source is subject to all restrictions specified by the licensing agreement
  5. ******************************************************************************/
  6.  
  7.  
  8. #define __AUSER_H
  9.  
  10. #if !defined(__OPTANSI_H)
  11. #include "ansi.h"
  12. #endif
  13.  
  14. /*****************************************************************************
  15.  AUSER.H
  16.  This is a header designed to use YOUR text output libraries with OptANSI
  17.  functions. Because OptANSI returns pointers that share the same buffer area
  18.  for strings, it cannot have multiple calls to similar OptANSI functions in
  19.  the same function. Ex: This function below will fail:
  20.  
  21.         printf("%s%sHi", acolor(31), agotoxy(25, 10));
  22.  
  23.  But this would work:
  24.  
  25.         printf(acolor(31));
  26.         printf(agotoxy(25, 10);
  27.         printf("Hi");
  28.  
  29.  Since you're using this header file, you could write:
  30.  
  31.         acolor(31);
  32.         agotoxy(25, 10);
  33.         printf("Hi");
  34.  
  35.  Make sure to send these ANSI strings on separate lines.
  36.  
  37. *****************************************************************************/
  38.  
  39.  
  40. /*****************************************************************************
  41.  You can substitute printf with your own output function by changing aout
  42.  below. Default defines are set to use printf().
  43. *****************************************************************************/
  44. #define aout(prt)     printf(prt)
  45.  
  46.  
  47. #define agotoxy(x, y)                                    aout(agotoxy(x, y))
  48. #define adown(y)                                            aout(adown(y))
  49. #define aleft(x)                                            aout(aleft(x))
  50. #define asavecursor()                                    aout(asavecursor())
  51. #define arestorecursor()                            aout(arestorecursor())
  52. #define aclrscr()                                            aout(aclrscr())
  53. #define aclreol()                                            aout(aclreol())
  54.  
  55. #define acolor(nc)                                        aout(acolor(nc))
  56. #define ahighlight()                                    aout(ahighlight())
  57. #define ablink()                                            aout(ablink())
  58.  
  59. #define acmd(a, b)                                        aout(acmd(a, b))
  60. #define atest()                                                aout(atest())
  61. #define atest1()                                            aout(atest1())
  62. #define akeyboard(key, str, buf)            aout(akeyboard(key, str, buf))
  63. #define amode(mode, cmd)                            aout(amode(mode, cmd))
  64.  
  65.